class_name SkillCmdC
extends Node

const component_name := "SkillCmdC"

var _notify: Notify  #set from mutil
var _id: int  #entity id
var arr: Array = []
var value setget _set_val, _get_val


func _set_val(cmd):
	arr.append(cmd)
	if _notify:
		_notify.modify_event(_id, "value")


func _get_val():
	return arr


#-----------------------------------------------------
class SkillCmd:
	var skill_id: int
	var target1: int
	var target2: int

	func _init(_skill_id, _target1 = 0, _target2 = 0):
		skill_id = _skill_id
		target1 = _target1 if _target1 else 0
		target2 = _target2


class Skill:
	var model: ConfigModel
	var id: int
	var level := 0
	var next_time := 0

	func _init(_model, _level = 0):
		model = _model
		var ml = _model.get("level")
		level = _level if _level else ml if ml else 1

	func get(key):
		var local = .get(key)
		return local if local else model.get(key)
